    <script type="text/javascript" src="<?=base_url('data/js/jquery.validate.min.js')?>"></script>
    <script type="text/javascript">
        $(document).ready(function(){
        var rules_set = {required:true,number:true};
        $('#myform').validate({
                rules: {
                    <?php if($resto == 'velpa') echo 'wine_takeaway: rules_set,'; ?>
                    beverage: rules_set,
                    food: rules_set,
                    tobaco: rules_set,
                    others: rules_set,
                    discount_customer: rules_set,
                    discount_ocheck: rules_set,
                    rounding: rules_set,
                    tax: rules_set,
                    service: rules_set
                }
            }); 
        });
    </script>

    <style>
        #salesdata input{width: 100px;}
        #salesdata {border-collapse: collapse;}
        #salesdata th {
            text-align: left;
            text-decoration: underline;
        }
        #salesdata .arrow{
            width: 40px;
            text-align: center;
        }
        #salesdata .label{
            font-style: italic;
            width: 200px;
        }
        #salesdata .original{
            font-weight: bolder;
            width: 100px;
        }
        .content-item {margin-left: 30px;}
    </style>
    
    <title>Edit Sales</title>
</head>

<?php
    function same($key)
    {
        if($sales_ori[$key]!=$sales_mod[$key]) return false;
        else return true;
    }
?>

<body onload="getTime();">

    <div id="container">
        <div id="header">
            <div id="logoHeader"></div>
            <div id="accountName">
                <div id="accountInfo">
                <p><b><span id="date"></span>&nbsp;<span id="clock"></span></b></p>
                <br />
                <p><i>Selamat Datang, <?php echo $nama_akun; ?></i></p>
                </div>
            </div>
            <br class="clearfloat"/>
        </div>
        <!-- end #header -->
        <div id="naviLink">
            <ul id="navUL">
                <li><a href="<?php echo site_url('main/beranda');?>">Beranda</a></li>
                <li><a href="<?php echo site_url('main/admin');?>">Admin</a></li>
                <li><a href="<?php echo site_url('main/penjualan');?>">Penjualan</a></li>
                <li><a href="<?php echo site_url('main/inventaris');?>">Inventaris</a></li>
                <li><a href="<?php echo site_url('main/pembelian');?>">Pembelian</a></li>
                <li><a href="<?php echo site_url('main/log');?>">Log</a></li>
            </ul>
            <div id="divLogOut"><a href="<?php echo site_url('main/log_out');?>">Log Out</a></div>
        </div>
        <div id="mainContent">

            <div id="contentInfo">
                <div id="adminInfo">
                        <a>Penjualan</a>
                </div>
                <br class="clearfloat" />       
            </div>

            <div class="content-item" style="font-size:20px;font-weight:bolder;">
                Laporan sales <?php echo strtoupper($resto); ?> pada tanggal <?php echo $date; ?>
            </div>
            
            <br />
            
            <?php
                if(is_null($acc)) echo "<div class='content-item' style='font-style: italic'>Laporan belum pernah diubah oleh siapapun</div>";
                else echo "<div class='content-item' style='font-style: italic'>Laporan telah diubah oleh <span style='font-weight:bolder'>{$acc['user_name']} ({$acc['acc_name']})</span></div>";
            ?>
            
            <br />
            
            <form id="myform" method="post">
                <input type="hidden" name="date" value="<?=$date?>" />
                <table id="salesdata">
                    <tr>
                        <th>Item</th>
                        <th>Original</th>
                        <th></th>
                        <th>Modifikasi</th>
                    </tr>
                    <tr>
                        <td class="label">Beverage<?=($sales_ori['beverage']!=$sales_mod['beverage'])?'*':''?></td>
                        <td class="original"><?=$sales_ori['beverage']?></td>
                        <td class="arrow"><img src="<?=base_url('data/img/arrow_right_24.png')?>" title="Ubah menjadi" /></td>
                        <td><input type="text" id="beverage" name="beverage" value="<?=$sales_mod['beverage']?>"></td>
                    </tr>
                    <tr>
                        <td class="label">Food<?=($sales_ori['food']!=$sales_mod['food'])?'*':''?></td>
                        <td class="original"><?=$sales_ori['food']?></td>
                        <td class="arrow"><img src="<?=base_url('data/img/arrow_right_24.png')?>" title="Ubah menjadi" /></td>
                        <td><input type="text" id="food" name="food" value="<?=$sales_mod['food']?>"></td>
                    </tr>
                    <tr>
                        <td class="label">Tobaco<?=($sales_ori['tobaco']!=$sales_mod['tobaco'])?'*':''?></td>
                        <td class="original"><?=$sales_ori['tobaco']?></td>
                        <td class="arrow"><img src="<?=base_url('data/img/arrow_right_24.png')?>" title="Ubah menjadi" /></td>
                        <td><input type="text" id="tobaco" name="tobaco" value="<?=$sales_mod['tobaco']?>"></td>
                    </tr>
                    <?php if($resto == 'velpa'): ?>
                    <tr>
                        <td class="label">Take Away Wine<?=($sales_ori['wine_takeaway']!=$sales_mod['wine_takeaway'])?'*':''?></td>
                        <td class="original"><?=$sales_ori['wine_takeaway']?></td>
                        <td class="arrow"><img src="<?=base_url('data/img/arrow_right_24.png')?>" title="Ubah menjadi" /></td>
                        <td><input type="text" id="wine_takeaway" name="wine_takeaway" value="<?=$sales_mod['wine_takeaway']?>"></td>
                    </tr>
                    <?php endif; ?>
                    <tr>
                        <td class="label">Others<?=($sales_ori['others']!=$sales_mod['others'])?'*':''?></td>
                        <td class="original"><?=$sales_ori['others']?></td>
                        <td class="arrow"><img src="<?=base_url('data/img/arrow_right_24.png')?>" title="Ubah menjadi" /></td>
                        <td><input type="text" id="others" name="others" value="<?=$sales_mod['others']?>"></td>
                    </tr>
                    <tr>
                        <td class="label">Customer Discount<?=($sales_ori['discount_customer']!=$sales_mod['discount_customer'])?'*':''?></td>
                        <td class="original"><?=$sales_ori['discount_customer']?></td>
                        <td class="arrow"><img src="<?=base_url('data/img/arrow_right_24.png')?>" title="Ubah menjadi" /></td>
                        <td><input type="text" id="discount_customer" name="discount_customer" value="<?=$sales_mod['discount_customer']?>"></td>
                    </tr>
                    <tr>
                        <td class="label">O.Check/Entertainer<?=($sales_ori['discount_ocheck']!=$sales_mod['discount_ocheck'])?'*':''?></td>
                        <td class="original"><?=$sales_ori['discount_ocheck']?></td>
                        <td class="arrow"><img src="<?=base_url('data/img/arrow_right_24.png')?>" title="Ubah menjadi" /></td>
                        <td><input type="text" id="discount_ocheck" name="discount_ocheck" value="<?=$sales_mod['discount_ocheck']?>"></td>
                    </tr>
                    <tr>
                        <td class="label">Rounding<?=($sales_ori['rounding']!=$sales_mod['rounding'])?'*':''?></td>
                        <td class="original"><?=$sales_ori['rounding']?></td>
                        <td class="arrow"><img src="<?=base_url('data/img/arrow_right_24.png')?>" title="Ubah menjadi" /></td>
                        <td><input type="text" id="rounding" name="rounding" value="<?=$sales_mod['rounding']?>"></td>
                    </tr>
                    <tr>
                        <td class="label">Tax<?=($sales_ori['tax']!=$sales_mod['tax'])?'*':''?></td>
                        <td class="original"><?=$sales_ori['tax']?></td>
                        <td class="arrow"><img src="<?=base_url('data/img/arrow_right_24.png')?>" title="Ubah menjadi" /></td>
                        <td><input type="text" id="tax" name="tax" value="<?=$sales_mod['tax']?>"></td>
                    </tr>
                    <tr>
                        <td class="label">Service<?=($sales_ori['service']!=$sales_mod['service'])?'*':''?></td>
                        <td class="original"><?=$sales_ori['service']?></td>
                        <td class="arrow"><img src="<?=base_url('data/img/arrow_right_24.png')?>" title="Ubah menjadi" /></td>
                        <td><input type="text" id="service" name="service" value="<?=$sales_mod['service']?>"></td>
                    </tr>
                </table>
                <div class="content-item" style="margin-top: 15px;">
                    <input type="submit" name="submit" value="Simpan" />
                    <input type="button" value="Kembali" onclick="window.location = '<?=site_url('main/penjualan')?>'" />
                </div>
            </form>
        </div>